package com.hisoft.controller;

import com.hisoft.pojo.Item;
import com.hisoft.service.ItemService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

/**
 * @program: ssmsample
 * @description:
 * @author: wlg
 * @create: 2021-09-28 14:27:42
 **/
@Controller
@RequestMapping("/item/")
public class ItemController {
    @Resource
    private ItemService itemService;
    @RequestMapping("itemlist")
    public String queryAll(Model model){
        List<Item> items = itemService.queryItems();
        model.addAttribute("items",items);
        return "itemList";
    }
}
